from selenium.webdriver.common.by import By

class AdminCouponCouponRecordsLocator:
    # Promo Management 菜单
    promo_management_menu = (By.XPATH, "//div[contains(@data-menu-id,'PROMO_MANAGER')]")
    # Coupon Records菜单
    coupon_records_menu = (By.CSS_SELECTOR, '[path="/console/couponRecords')

    #搜索输入框
    template_search_input = (By.XPATH, "//input[@id='templateName']")
    no_search_input= (By.XPATH, "//input[@id='no']")
    #搜索按钮
    search_button = (By.XPATH, "//span[text()='Search']/..")
    #查询结果的数据量
    search_result_num = (By.XPATH, "//li[contains(@class,'antd4-pagination-total-text')]")

    # empty
    empty_tips = (By.XPATH, "//div[contains(@class, 'antd4-empty-description')]")


    #coupon records列表属性
    # Coupon No.
    record_list_coupon_no = (By.XPATH, '//th[text() = "Coupon No."]')
    # status
    record_list_status = (By.XPATH, '//span[text() = "Status"]')
    # Coupon Template
    record_list_coupon_template = (By.XPATH, '//th[text() = "Coupon Template"]')
    # Account Email
    record_list_account_email = (By.XPATH, '//th[text() = "Account Email"]')
    # Percent
    record_list_percent = (By.XPATH, '//th[text() = "Percent"]')
    # Fixed Amount
    record_list_fixed_amount = (By.XPATH, '//th[text() = "Fixed Amount"]')
    # Deducted by Coupons
    record_list_deducted_by_coupons = (By.XPATH, '//th[text() = "Deducted by Coupons"]')
    # Coupon Balance
    record_list_coupon_balance = (By.XPATH, '//th[text() = "Coupon Balance"]')
    # Reuse
    record_list_reuse = (By.XPATH, '//th[text() = "Reuse"]')
    # Bind
    record_list_bind = (By.XPATH, '//span[text() = "Bind"]')
    # Validation Period
    record_list_validation_period = (By.XPATH, '//th[text() = "Validation Period (UTC+08:00)"]')

    # 第一个查询结果
    first_search_result = (By.XPATH, '//*[@id="root"]/section/section/main/div/div/div/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[1]/div/div')
    # 第一个查询结果的coupon template的值
    first_search_result_coupon_template = (By.XPATH, '//*[@id="root"]/section/section/main/div/div/div/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[3]/div')

    # 第一个查询结果的bind的值
    first_search_result_bind = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[10]')
    # 第一个查询结果的account_email的值
    first_search_result_account_email = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[4]')

    #状态筛选按钮
    status_filter_button = (By.XPATH, "//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')]")
    status_filter_valid_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[1]')
    status_filter_exhausted_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[2]')
    status_filter_expired_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[3]')
    status_filter_ok_button = (By.XPATH, '//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")]//span[text()="OK"]/..')
    status_filter_reset_button = (By.XPATH, '(//span[text()="Reset"])[2]')

    # bind筛选按钮
    bind_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[2]")
    # bind_filter_y_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[1]')
    # bind_filter_n_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[2]')
    bind_filter_ok_button = (By.XPATH, '(//span[text()="OK"])[2]')
    bind_filter_reset_button = (By.XPATH, '(//span[text()="Reset"])[3]')
    bind_filter_y_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Y"]')
    bind_filter_n_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="N"]')










